<template>
  <a 
    class="btn" 
    title="➕发布任务"
    @click.prevent="$emit('click')"
  >
    <span class="top">⭐SKILLITH</span>
    <span class="btm">➕发布任务</span>
  </a>
</template>

<style lang="scss">
@use "sass:color";

$size: 10em;
$primary: #4361ee; // 更专业的蓝色调
$secondary: #3a0ca3; // 深蓝色作为辅助色
$accent: #4cc9f0; // 亮蓝色作为点缀
$textColor: #f8f9fa; // 更柔和的白色
$shadowColor: #2e3a45; // 更深的阴影色

.btn {
  margin-top: -15px;
  width: $size;
  height: $size * 0.375;
  background: linear-gradient(145deg, $primary, $secondary); // 添加渐变效果
  color: $textColor;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border-radius: $size * 0.05;
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif; // 更现代的字体组合
  position: relative;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); // 更平滑的过渡
  cursor: pointer;
  padding: 0;
  border: none;
  outline: none;
  box-shadow: 
    0 ($size * 0.075) 0 color.scale($secondary, $lightness: -15%),
    0 ($size * 0.125) 0 ($size * 0.035) color.scale($shadowColor, $alpha: -50%);
  
  &:hover,
  &:focus {
    background: linear-gradient(145deg, lighten($primary, 5%), lighten($secondary, 5%));
    transform: translateY(-0.2em);
    box-shadow: 
      0 ($size * 0.075 + 0.2em) 0 color.scale($secondary, $lightness: -15%),
      0 ($size * 0.125 + 0.2em) 0 ($size * 0.035) color.scale($shadowColor, $alpha: -40%);
  }

  &:active {
    transform: translateY(($size * 0.025));
    box-shadow: 
      0 ($size * 0.05) 0 color.scale($secondary, $lightness: -15%),
      0 ($size * 0.075) 0 ($size * 0.025) color.scale($shadowColor, $alpha: -60%);
    transition: all 0.1s;
  }

  // 添加微妙的发光效果
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 ($size * 0.05) rgba($accent, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
  }

  &:hover::after {
    opacity: 1;
  }
}

.top { 
  font-size: ($size * 0.1);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.2em;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba($shadowColor, 0.2);
}

.btm { 
  font-size: ($size * 0.15);
  display: block;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba($shadowColor, 0.2);
}
</style>